<template>
    <el-dialog
    title="发票信息详情"
    :visible.sync="dataBill.dialogState"
    size="tiny"
    class="dialog-box"
    @open='open'
    >
        <el-form v-loading='loading' class="form-content" label-width="140px"  label-position='right'>
            <el-row :gutter="21" class="school-item">
                <el-col :span="24">
                    <el-form-item label="发票类型：">
                       <span>{{dataShow.billType=='0'?'增值税普通发票':dataShow.billType=='1'?'增值税专用发票':'--'}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="21" class="school-item">
                <el-col :span="24">
                    <el-form-item label="收票人：">
                        <span>{{dataShow.sName | isNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="21" class="school-item">
                <el-col :span="24">
                    <el-form-item label="发票金额（元）：">
                       <span>{{dataShow.sMoney | isNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="21" class="school-item">
                <el-col :span="24">
                    <el-form-item label="收票人手机：">
                        <span>{{dataShow.sPhone | isNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="21" class="school-item">
                <el-col :span="24">
                    <el-form-item label="收票人邮箱：">
                       <span>{{dataShow.sMail | isNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="21" class="school-item">
                <el-col :span="24">
                    <el-form-item label="收票人地址：">
                        <span>{{dataShow.sAddr | isNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="21" class="school-item">
                <el-col :span="24">
                    <el-form-item label="单位名称：">
                       <span>{{dataShow.orgName | isNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="21" class="school-item">
                <el-col :span="24">
                    <el-form-item label="纳税人识别码：">
                        <span>{{dataShow.sIdCode | isNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="21" class="school-item">
                <el-col :span="24">
                    <el-form-item label="注册地址：">
                       <span>{{dataShow.sRegisterAddr | isNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="21" class="school-item">
                <el-col :span="24">
                    <el-form-item label="注册电话：">
                        <span>{{dataShow.sRegisterPhone | isNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="21" class="school-item">
                <el-col :span="24">
                    <el-form-item label="开户银行：">
                       <span>{{dataShow.sBank | isNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="21" class="school-item">
                <el-col :span="24">
                    <el-form-item label="银行账户：">
                        <span>{{dataShow.sBankAccount | isNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
    </el-dialog>
</template>

<script>
    import { getIncrementBillByDetailId } from 'api/serviceManage';
    export default {
        props: {
            dataBill: {
                type: Object,
                required: true
            }
        },
        data() {
            return {
                loading: false,
                dataShow: ''
            }
        },
        computed: {
            
        },
        methods: {
            open() {
                this.loading = true;
                getIncrementBillByDetailId(this.dataBill.id).then(res => {
                    this.loading = false;
                    if (res.data.content) {
                        this.dataShow = res.data.content;
                    }
                }).catch(() => {
                    this.loading = false;
                });
            },
            submitForm() {
                
                let pId = this.auditData.dataList.pId; // 收费记录ID
                let sStatus = '2'; // 状态(0:未开通，1：审核中，2：已开通，3:审核未通过)
                this.loading = true;
                updatePayRecord(pId, sStatus).then(response => {
                    this.loading = false;
                    this.$message.success(response.data.errorMsg);
                    this.auditData.dialogState = false;
                    this.$emit('search');
                })
                 
            },
            resetForm() {
                let pId = this.auditData.dataList.pId; // 收费记录ID
                let sStatus = '3'; // 状态(0:未开通，1：审核中，2：已开通，3:审核未通过)
                this.loading = true;
                updatePayRecord(pId, sStatus).then(response => {
                    this.loading = false;
                    this.$message.success(response.data.errorMsg);
                    this.auditData.dialogState = false;
                    this.$emit('search');
                })
            }
        }
    }

</script>

<style lang="scss">
    .dialog-box{
        .el-dialog__header{
            text-align:center;
            background:#f7f7f9;
            height:54px;
            .el-dialog__title{
                font-size:20px;
                color:#333;
            }
        }
        .form-content{
            font-size: 12px;
            color: #333;
            width: 80%;
            margin: 0 auto; 
            .el-form-item {
                margin-bottom: 0px; 
            }
        }
        .dialog-footer{
            width: 80%;
            margin: 0 auto; 
            text-align:center;
        }
    }
</style>